package util;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;

public class LevelWriter {
	BufferedWriter writer = null;

	public static void main(String[] args) {
		LevelWriter w = new LevelWriter(1);
		w.write("a");
		w.close();
	}
	
	public LevelWriter(int level) {
		try {
			writer = new BufferedWriter(new FileWriter("D:\\answer\\level" + level
					+ ".txt",true));
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	public void write(String str){
		try {
			writer.write(str);
			writer.newLine();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	
	public void close(){
		if(writer != null){
			try {
				writer.close();
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
	}
}
